﻿import os
import sys
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, BASE_DIR)
from parse_review.parse_utils import sku_ids, texts, TmallText
from datetime import datetime
from Logs.log import log1

def assort_review():
    # 获取sku_id
    sku_list = sku_ids()
    for tuple in sku_list:
        code = tuple[2]
        sku_detail_id = tuple[1]
        if int(code) == 6:
            TmallText(sku_detail_id)
        else:
            texts(sku_detail_id, int(code))  # 生成好评与差评txt文件
    log1.info("好差评分析End!")



if __name__ == '__main__':
    assort_review()